<template>
    <div>
        <input type="text" :value="content" @input="ipt">
        <button @click="add">添加待办事项</button>
    </div>
</template>

<script>
import {defineComponent} from 'vue'
export default defineComponent({
    props:{
        content:{
            type:String,
            default:''
        }
    },
    setup(props,{emit}){

        //input
        let ipt = (e) => {
            emit('update:content',e.target.value)
        }

        let add = () => {
            emit('add');
        }
        return {
            add,
            ipt
        }
    }
})
</script>